package com.example.lotteryticketdev.tool;


import com.example.lotteryticketdev.config.ConstantPropertiesForEmail;
import com.sgq.MailConfig163;

import java.util.Map;
import java.util.Properties;

public class EmailPlusTool {

    public static void send(Map map){
        Properties from = new Properties();
        from.setProperty("foxmail.host",ConstantPropertiesForEmail.HOST);
        from.setProperty("foxmail.host.mail",ConstantPropertiesForEmail.MAIL);
        from.setProperty("foxmail.smtp.pwd",ConstantPropertiesForEmail.PASSWORD);
        from.setProperty("foxmail.transport.protocol",ConstantPropertiesForEmail.TRANSPORT_PROTOCOL);

        Properties to = new Properties();
        to.setProperty("mail_target",ConstantPropertiesForEmail.TARGET);
        to.setProperty("mail_title",ConstantPropertiesForEmail.TITLE);
        to.setProperty("mail_content",map.get("mail_content").toString());
        Map envelope = MailConfig163.config(from, to);
        MailConfig163.send(envelope);

    }

}
